#include <stdio.h>
#include <malloc.h>
#include <assert.h>
//#include "piece.h"
#include "terrain.h"

void terInit(Field *pTer)
{
	int x,y;

	const char terrain_defaut[15][20] = {
		"####################",
		"#..................#",
		"#..................#",
		"#..................#",
		"#..................#",
		"#..................#",
		"#..................#",
		"#..................#",
		"#..................#",
		"#..................#",
		"#..................#",
		"#..................#",
		"#..................#",
		"#..................#",
        "####################"
    };

	pTer->dimx = 20;
	pTer->dimy = 15;

	pTer->tab = (char **)malloc(sizeof(char *)*pTer->dimy);
	for (y=0; y<pTer->dimy; y++)
		pTer->tab[y] = (char *)malloc(sizeof(char)*pTer->dimx);

	for(y=0;y<pTer->dimy;++y)
		for(x=0;x<pTer->dimx;++x)
			pTer->tab[y][x] = terrain_defaut[y][x];

}



Field * CreateField())
{
	Field *field;
	field = (Field *)malloc(sizeof(Field));
	return field;
}



void InitField Field* Sfield)
{



	Sfield->dimx = 0;
	Sfield->dimy = 0;
	int i,j;




